package org.trendit

class Post {

   String content 
   Date dateCreated
   String type
   String version1
   String title  //(optional)
   String author_name1  //(optional)
   String author_url//(optional)
   String provider_name //(optional)
   String provider_url //(optional)
   String thumbnail_url //(optional)A URL to a thumbnail image
   int thumbnail_width //(optional)
   int thumbnail_height //(optional)
   String description
   String url //(may be optional)
   String html //(may be optional)
   static constraints = {
	url(nullable:true)
    type(nullable:true)
	version1(nullable:true)
	title(nullable:true)  //(optional)
	author_name1(nullable:true)  //(optional)
	author_url(nullable:true)  //(optional)
	 provider_name(nullable:true) //(optional)
	 provider_url(nullable:true) //(optional)
	 thumbnail_url(nullable:true) //(optional)A URL to a thumbnail image
	 thumbnail_width(nullable:true) //(optional)
	 thumbnail_height(nullable:true) //(optional)
	 description(nullable:true)
	 //url(nullable:true) //(may be optional)
	 html(nullable:true) //(may be optional)
	 content(blank: false)
}
      //static hasOne = [postDetail:PostDetail]
   Post(String s){
	   this.content= s
	   //dateCreated = 
   }
  
   static belongsTo = [ user : User ]
   static mapping = {
	   sort dateCreated:"desc"
	   }
   static hasMany = [ tags : Tag ]
}
